﻿using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Palindrom_LongString_LiterMatches
{
    class LongestSentence
    {

        public static void FindLongestSentenceFromText()
        {
            string textFile = @"C:\My files\HT.txt";
            string textFromFile = File.ReadAllText(textFile);
            string textFromFileFinal = textFromFile.Replace("\r\n\r\n", " ");
            string[] sentences = textFromFileFinal.Split('.');
            int longsentence = 0;
            for (int i = 0; i < sentences.Length; i++)
            {
                if (longsentence < sentences[i].Count())
                    longsentence = sentences[i].Count();
            }
            for (int i = 0; i < sentences.Length; i++)
            {
                if (longsentence == sentences[i].Count())
                    Console.WriteLine(i+1);
            }
        }
    }
}
